home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
macros
/
mathematica
/
tex-mma.tar_z
/
tex-mma
/
addBBox
next >
Wrap
Text File
|
1991-02-04
|
870b
|
41 lines
#! /bin/sh
cmd=addBBox
# cmd height fontsize
# Filter to set bounding box of Mathematica graphics for inclusion in TeX
# 2/4/1991 adaptation by Dan Dill dan@chem.bu.edu of
# original written by Cameron Smith cameron@midd.bitnet
# to set fontsize
if [ $# -lt 2 ]
then
echo Usage: $cmd height fontsize
echo Adjust height and fontsize of Mathematica graphics.
echo See the $cmd shell script for details
exit 1
fi
height=$1
fontsize=$2
# save the graphic in a temp file
cat >/tmp/mmatemp.$$.ps
# get width
asprat=`awk '/AspectRatio/&&flag==0 {print $2; flag=1}' /tmp/mmatemp.$$.ps`
width=`echo "$height / $asprat" | bc`
# emit header
echo "%%BoundingBox: 0 0 $width $height"
echo "/Mfontsize $fontsize def"
echo "/Mwidth $width def"
echo "/Mheight $height def"
echo "/Mnodistort true def"
# copy file
cat /tmp/mmatemp.$$.ps
# remove temp file
rm /tmp/mmatemp.$$.ps